主题
解绑 - UnBind
函数简介
解绑当前已授权设备上的授权信息。调用后由服务端按当前设备上下文执行解绑逻辑。
换机场景:若新设备尚无授权,请使用 强制解绑 - ForceUnBind(须软件发布者开启「开放客户端解绑」)。
返回数据格式:
json
{
"Code": 1,
"ServerTime": "2026-04-24 10:00:00.000",
"Message": "",
"LicenceKeys": ["xxxx-xxxx-xxxx"]
}| 字段名 | 说明 |
|---|---|
| Code | 结果状态码:1 成功,0 失败。 |
| ServerTime | 服务器时间。 |
| Message | 提示信息;失败时多为 错误码:中文描述(如 "2003:参数无效")。完整对照见 客户端错误码说明。 |
| LicenceKeys | 本次返回的激活码列表(可能为空)。 |
常见错误码(Message 字段)
| Message | 含义 |
|---|---|
2003:参数无效 | 参数无效 |
2004:用户不存在 | 用户不存在 |
2005:软件不可用或未开通 | 软件不可用或未开通 |
2015:未找到可解绑设备授权 | 当前用户名下无对应设备授权 |
2016:试用授权不支持解绑 | 试用授权禁止解绑 |
2017:激活码不属于当前用户设备 | 指定激活码归属校验失败 |
2099:… | 解绑业务失败 |
2099:未知错误 | 未知错误 |
接口名称
UnBindDLL调用
long UnBind(string userCode, string softCode, string softVersion, string dealerCode);参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| userCode | 字符串 | 用户码。 |
| softCode | 字符串 | 软件码。 |
| softVersion | 字符串 | 软件版本。 |
| dealerCode | 字符串 | 经销商码。 |
示例
SDK 调用
cpp
#include "OLAPlugServer.h"
OLAPlugServer ola;
OlaAuthUnbindReturn result = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode");
// result.Code == 1 表示解绑成功csharp
using OLAPlug;
var ola = new OLAPlugServer();
OlaAuthUnbindReturn result = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode");
// result.Code == 1 表示解绑成功python
from OLAPlugServer import OLAPlugServer
ola = OLAPlugServer()
json_result = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode")
# Python SDK 返回 JSON 字符串,需自行解析java
import com.olaplug.OLAPlugServer;
import com.olaplug.model.OlaAuthUnbindReturn;
OLAPlugServer ola = new OLAPlugServer();
OlaAuthUnbindReturn result = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode");
// result.Code == 1 表示解绑成功go
import "github.com/ola/olaplug/olaplug"
ola, _ := olaplug.NewOLAPlugServer("OLAPlug_x64.dll")
defer ola.ReleaseObj()
result := ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode")
// result.Code == 1 表示解绑成功rust
use olaplug::OLAPlugServer;
let ola = OLAPlugServer::new("OLAPlug_x64.dll").unwrap();
let result = ola.un_bind("userCode", "softCode", "1.0.0", "dealerCode");
// result.code == 1 表示解绑成功cpp
var ola = com("OlaPlug.OlaSoft")
var result = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode")vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
Set result = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode")text
.局部变量 ola, OLAPlug
.局部变量 result, OlaAuthUnbindReturn
ola.创建 ()
result = ola.UnBind(“userCode”, “softCode”, “1.0.0”, “dealerCode”)aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var json = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode");
// Aardio SDK 返回 JSON 字符串,需自行解析text
变量 ola <类型 = OLAPlugServer>
变量 result <类型 = OlaAuthUnbindReturn>
ola = 新建 OLAPlugServer
result = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode")cpp
#include "OLAPlugServer.h"
OLAPlugServer ola;
OlaAuthUnbindReturn result = ola.UnBind("userCode", "softCode", "1.0.0", "dealerCode");
// result.Code == 1 表示解绑成功原生 DLL 调用
cpp
UnBind(instance, "userCode", "softCode", "1.0.0", "dealerCode");csharp
using System.Runtime.InteropServices;
using System.Text;
[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern long UnBind(string userCode, string softCode, string softVersion, string dealerCode);
UnBind(instance, "userCode", "softCode", "1.0.0", "dealerCode");python
from ctypes import CDLL, c_int, c_int64, create_string_buffer
ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
ola.UnBind(instance, "userCode", "softCode", "1.0.0", "dealerCode")返回值
| 调用方式 | 返回值 | 说明 |
|---|---|---|
| SDK | OlaAuthUnbindReturn | 结构化返回对象;Code == 1 表示解绑成功 |
| 原生 DLL | 非 0 | 成功,返回 JSON 字符串格式的结果。 |
| 原生 DLL | 0 | 失败。 |
注意事项
| 项目 | 说明 |
|---|---|
| 释放内存 | 返回的字符串指针需要调用 FreeStringPtr 接口释放内存。 |
| 返回的激活码可以用于二次授权 | 返回的激活码可以用于二次授权。 |
| 错误码 | Code == 0 时根据 Message 处理;完整码表见 客户端错误码说明。换机场景见 ForceUnBind。 |
